<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

    <h1>这是h1的内容</h1>
    <h1>这是h1的内容</h1>


    <!--按钮绑定 点击事件-->
    <button onclick="setColor()">设置颜色为红色！</button>

    <script !src="">
        function setColor(){
            /*完成对h1颜色的设置*/
            var h1 = document.getElementsByTagName("h1")
            console.log(h1)
            h1[0].style.color = "red"
            h1[1].style.color = "red"
            /*对第二个h1内容的改变*/
            h1[1].innerText = "这是修改后的内容！"

        }

    </script>
</body>
</html>